'use strict';

import Base from './base.js';

export default class extends Base {
  /**
   * index action
   * @return {Promise} []
   */
  async getcustomerAction() {
    let data = await this.model('customer')
      .alias('customer')
      .field('`customer`.*, `address`.`address` as "addressname"')
      .join([{
        table: 'address',
        as: 'address',
        on: ['`customer`.`address_id`', '`address`.`address_id`']
      }])
      .where({"customer.customer_id":{"<":10},"address.address_id":{">":10}})
      .select();
    this.success(data);
  }


  async getstoreAction() {
    let data = await this.model('store')
      .select();
    this.success(data);
  }



}
